﻿CREATE TABLE [dbo].[DbOperationDetailLog] (
    [ID]               UNIQUEIDENTIFIER DEFAULT (newid()) ROWGUIDCOL NOT NULL,
    [DbOperationLogID] UNIQUEIDENTIFIER NOT NULL,
    [TableName]        [sysname]        NOT NULL,
    [TablePrimaryKey]  NVARCHAR (30)    NULL,
    [Description]      NVARCHAR (MAX)   NULL,
    [OperationType]    NVARCHAR (50)    NULL,
    [Flag]             BIT              NULL,
    [OperaDate]        DATETIME         CONSTRAINT [DF_Data_LogDetailOfDBOperation_OperaDate] DEFAULT (getdate()) NULL,
    CONSTRAINT [PK_DATA_LogDetailOfDBOperation] PRIMARY KEY CLUSTERED ([ID] ASC),
    CONSTRAINT [FK_DATA_LogDetailOfDBOperation_DATA_LogOfDBOperationID] FOREIGN KEY ([DbOperationLogID]) REFERENCES [dbo].[DbOperationLog] ([ID])
);

